<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>添加人员标签页面</title>
  <link rel="stylesheet" href="./../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../yl/style.css" />
  <link rel="stylesheet" href="../../yl/mobile.css" />
  <link rel="stylesheet" href="../../yl/easyui.css" />
  <link rel="stylesheet" href="../../yl/icon.css" />
</head>


<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app">
    <header>
      <div class="m-toolbar">
        <div class="m-title">添加重点人员标注信息</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'personal_information', 'form': 'dataForm' ,'primary_key':'ID_Card_Number'})">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">人员信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">身份证</div>
              </template>
              <el-form-item prop="ID_Card_Number" :rules="[{ required: true, message: '请选择身份证', trigger: 'change' }]">
                <!-- <el-input @change="shibie" v-model="dataForm.ID_Card_Number" class="borderless-input"  placeholder="请输入身份证" /> -->
                <yl-select v-model="dataForm.ID_Card_Number" clearable @change="shibie" filterable
                  placeholder="请选择身份证编号" :options="personal_information"
                  :props="{value:'ID_Card_Number',label:'ID_Card_Number'}">
                  <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip
                    label="身份证号"></el-table-column>
                  <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                  <el-table-column prop="Birthday" show-overflow-tooltip label="出生日期"></el-table-column>
                  <el-table-column prop="Gender" label="性别"></el-table-column>
                  <el-table-column prop="Nation" label="民族"></el-table-column>
                  <el-table-column prop="Registered_Residence" show-overflow-tooltip label="籍贯"></el-table-column>
                  <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">姓名</div>
              </template>
              <el-form-item prop="Personal_Name">
                <el-input disabled v-model="dataForm.Personal_Name" class="borderless-input" placeholder="请输入姓名" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">性别</div>
              </template>
              <el-input disabled v-model="dataForm.Gender" class="borderless-input" placeholder="请输入性别" />
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">出生日期</div>
              </template>
              <el-input disabled v-model="dataForm.Birthday" class="borderless-input" placeholder="请输入出生日期" />
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">户籍地</div>
              </template>
              <el-input disabled v-model="dataForm.Registered_Residence" class="borderless-input"
                placeholder="请输入户籍地" />
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">现居地址</div>
              </template>
              <el-input v-model="dataForm.Home_Address" class="borderless-input" placeholder="请输入家庭地址" />
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">历史标签</div>
              </template>
              <!-- <div class="block" style="color:#606266;"> -->
              <el-timeline :reverse="reverse" class="custom-timeline">
                <el-timeline-item v-for="(activity, index) in activities" :key="index">
                  <div class="hui">标签类型：{{activity.Personal_Tag}}</div>
                  <div class="hui">标注原因：{{activity.Reason}}</div>
                  <div class="hui">标记时间：{{activity.Create_Datetime}}</div>
                  <div class="hui">状态：{{activity.Row_Status=='0'?'生效中':'已取消'}}</div>
                  <div class="hui" v-if="activity.Row_Status=='1'">取消原因：{{activity.Cancel_Reason}}</div>
                </el-timeline-item>
              </el-timeline>
              <div>
                <el-tag  closable style="margin-right: 10px; margin-bottom: 10px;color: #fff;border:none" v-for="(item, index) in activities1"  @close="handleClose(item)"
                  :key="index" :style="{backgroundColor:item.Personal_Tag=='A类人员'?'#B71C1C':item.Personal_Tag=='B类人员'?'#F57F17':item.Personal_Tag=='C类人员'?'#309bff':item.Personal_Tag=='D类人员'?'#2bdd07':''}">{{item.Personal_Tag}}</el-tag>
              </div>
              <div v-if="activities.length == 0" style="margin-left: 10px;">暂无历史标签</div>
              <!-- <el-select :value="" clearable placeholder="请选择人员标签" filterable
                style="width: 100%">
                <el-option
                  v-for="item in options.filter(i=>i.Personal_Tag_SerialNumber==childDataForm[index].Personal_Tag_SerialNumber||!childDataForm.filter(item => item.Row_Status != '1').some(x=>i.Personal_Tag_SerialNumber==x.Personal_Tag_SerialNumber))"
                  :key="item.Personal_Tag_SerialNumber" :label="item.Personal_Tag"
                  :value="item.Personal_Tag_SerialNumber">
                </el-option>
              </el-select> -->
              <!-- </div> -->
            </el-descriptions-item>
          </el-descriptions>
        </el-form>

        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">人员标签类型</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm}" ref="form1" :inline-message="true" style="width: 100%">
            <el-descriptions
              :data-options="JSON.stringify({ 'TableName': 'personal_mapping_tags', 'form': 'childDataForm', 'ParentTableName': 'personal_information'})"
              :column="2" size="large" border>
              <template v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index">
                <el-descriptions-item>
                  <template #label>
                    <div class="cell-item">标签{{index + 1}}</div>
                  </template>
                  <el-form-item :prop="'childDataForm.'+index+'.Personal_Tag_SerialNumber'"
                    :rules="[{ required: true, message: '请选择人员标签', trigger: 'change' }]">
                    <el-select v-model="item.Personal_Tag_SerialNumber" clearable placeholder="请选择人员标签" filterable
                      style="width: 100%">
                      <el-option v-for="item in options" :key="item.Personal_Tag_SerialNumber"
                        :label="item.Personal_Tag" :value="item.Personal_Tag_SerialNumber">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item>
                  <template #label>
                    <div class="cell-item">原因</div>
                  </template>
                  <el-form-item :prop="'childDataForm.'+index+'.Reason'" :rules="[{ required: true, message: '请输入原因', trigger: 'blur' }]">
                    <el-input v-model="item.Reason" class="borderless-input" placeholder="请输入原因" />
                  </el-form-item>
                </el-descriptions-item>
              </template>
            </el-descriptions>
          </el-form>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
  <script src="../../utils/utils.js"></script>
  <script src="../../utils/mixins.js"></script>
  <script src="../../config/config.js"></script>
  <script src="../../yl/vue.js"></script>
  <script src="../../yl/index.js"></script>
  <script src="../../yl/zh-cn.mjs"></script>
  <script src="../../yl/index.iife.min.js"></script>
  <script src="../../yl/jquery.min.js"></script>
  <script src="../../utils/jquery.cookie.js"></script>
  <script src="../../yl/jquery.easyui.min.js"></script>
  <script src="../../yl/jquery.easyui.mobile.js"></script>
  <script src="../../yl/moment.min.js"></script>
  <script src="../../api/request.js"></script>
  <script src="./js/party_feesAdd.js"></script>
</body>

</html>